package com.fmsh.nfcsensor.utils;

/**
 * @author wuyajiang
 * @date 2022/11/2
 */
public class Constants {

    public static String KEY_NFC_TAG = "nfc_tag";

    public static String KEY_NFCA_OPERATION_TYPE = "nfcA_operation_type";

    public static String KEY_HANDLE_SEND_MSG = "handle_send_msg";


    /**
     * 成功
     */
    public final static int SUCCESS_RESULT = 0;

    /**
     * 未知错误
     */
    public final static int NFC_UNKNOWN_ERROR = 1;
    /**
     * 标签类型不是NFCA
     */
    public final static int NFC_NO_TYPE_NFCA = 2;
    /**
     * 标签认证失败
     */
    public final static int NFC_AUTH_FAILED = 3;
    /**
     * 芯片未初始化,没有传感器
     */
    public final static int NFC_NO_SENSOR = 4;


    public final static int T_VALUE = 1001; // 温度
    public final static int H_VALUE = 1002; // 湿度
    public final static int P_VALUE = 1003; // 气压
    public final static int B_VALUE = 1004; // 光照
    public final static int VOC_VALUE = 1005; // 气体 voc
    public final static int NOX_VALUE = 1006; // 气体 nox
    public final static int CO2_VALUE = 1007; // co2


    /**
     * 初始化 非接认证命令
     */
    public static String COMMAND_AUTH = "1BFFFFFFFF";

    /**
     * 发送写寄存器命令
     */
    public static String COMMAND_WRITE_REG = "AFB00180";
    /**
     * 读取传感器数据
     */
    public static String COMMAND_READ_SENSOR = "3004";


    public static final double BMP2_MIN_TEMP_DOUBLE = -40.0f;
    public static final double BMP2_MAX_TEMP_DOUBLE = 85.0f;
    public static final double BMP2_MIN_PRES_DOUBLE = 30000.0f;
    public static final double BMP2_MAX_PRES_DOUBLE = 110000.0f;


    public static final int GAIN = 64;
    public static final double ITIME_MS = 2.8 / 1000 * 964.0 * (256.0 - 218);



    public static final int GasIndexAlgorithm_ALGORITHM_TYPE_VOC = 0;
    public static final int GasIndexAlgorithm_ALGORITHM_TYPE_NOX = 1;
    public static final float GasIndexAlgorithm_DEFAULT_SAMPLING_INTERVAL = 1.f;
    public static final float GasIndexAlgorithm_INITIAL_BLACKOUT = 45.f;
    public static final float GasIndexAlgorithm_INDEX_GAIN = 230.f;
    public static final float GasIndexAlgorithm_SRAW_STD_INITIAL = 50.f;
    public static final float GasIndexAlgorithm_SRAW_STD_BONUS_VOC = 220.f;
    public static final float GasIndexAlgorithm_SRAW_STD_NOX = 2000.f;
    public static final float GasIndexAlgorithm_TAU_MEAN_HOURS = 12.f;
    public static final float GasIndexAlgorithm_TAU_VARIANCE_HOURS = 12.f;
    public static final float GasIndexAlgorithm_TAU_INITIAL_MEAN_VOC = 20.f;
    public static final float GasIndexAlgorithm_TAU_INITIAL_MEAN_NOX = 1200.f;
    public static final float GasIndexAlgorithm_INIT_DURATION_MEAN_VOC = 3600.f * 0.75f;

    public static final float GasIndexAlgorithm_INIT_DURATION_MEAN_NOX = 3600.f * 4.75f;

    public static final float GasIndexAlgorithm_INIT_TRANSITION_MEAN = 0.01f;
    public static final float GasIndexAlgorithm_TAU_INITIAL_VARIANCE = 2500.f;
    public static final float GasIndexAlgorithm_INIT_DURATION_VARIANCE_VOC = 3600.f * 1.45f;

    public static final float GasIndexAlgorithm_INIT_DURATION_VARIANCE_NOX = 3600.f * 5.70f;

    public static final float GasIndexAlgorithm_INIT_TRANSITION_VARIANCE = 0.01f;
    public static final float GasIndexAlgorithm_GATING_THRESHOLD_VOC = 340.f;
    public static final float GasIndexAlgorithm_GATING_THRESHOLD_NOX = 30.f;
    public static final float GasIndexAlgorithm_GATING_THRESHOLD_INITIAL = 510.f;
    public static final float GasIndexAlgorithm_GATING_THRESHOLD_TRANSITION = 0.09f;
    public static final float GasIndexAlgorithm_GATING_VOC_MAX_DURATION_MINUTES = 60.f * 3.f;

    public static final float GasIndexAlgorithm_GATING_NOX_MAX_DURATION_MINUTES = 60.f * 12.f;

    public static final float GasIndexAlgorithm_GATING_MAX_RATIO = 0.3f;
    public static final float GasIndexAlgorithm_SIGMOID_L = 500.f;
    public static final float GasIndexAlgorithm_SIGMOID_K_VOC = -0.0065f;
    public static final float GasIndexAlgorithm_SIGMOID_X0_VOC = 213.f;
    public static final float GasIndexAlgorithm_SIGMOID_K_NOX = -0.0101f;
    public static final float GasIndexAlgorithm_SIGMOID_X0_NOX = 614.f;
    public static final float GasIndexAlgorithm_VOC_INDEX_OFFSET_DEFAULT = 100.f;
    public static final float GasIndexAlgorithm_NOX_INDEX_OFFSET_DEFAULT = 1.f;
    public static final float GasIndexAlgorithm_LP_TAU_FAST = 20.0f;
    public static final float GasIndexAlgorithm_LP_TAU_SLOW = 500.0f;
    public static final float GasIndexAlgorithm_LP_ALPHA = -0.2f;
    public static final int GasIndexAlgorithm_VOC_SRAW_MINIMUM = 20000;
    public static final int GasIndexAlgorithm_NOX_SRAW_MINIMUM = 10000;
    public static final float GasIndexAlgorithm_PERSISTENCE_UPTIME_GAMMA = 3.f * 3600.f;
    public static final float GasIndexAlgorithm_TUNING_INDEX_OFFSET_MIN = 1;
    public static final float GasIndexAlgorithm_TUNING_INDEX_OFFSET_MAX = 250;
    public static final float GasIndexAlgorithm_TUNING_LEARNING_TIME_OFFSET_HOURS_MIN = 1;
    public static final float GasIndexAlgorithm_TUNING_LEARNING_TIME_OFFSET_HOURS_MAX = 1000;
    public static final float GasIndexAlgorithm_TUNING_LEARNING_TIME_GAIN_HOURS_MIN = 1;
    public static final float GasIndexAlgorithm_TUNING_LEARNING_TIME_GAIN_HOURS_MAX = 1000;
    public static final float GasIndexAlgorithm_TUNING_GATING_MAX_DURATION_MINUTES_MIN = 0;
    public static final float GasIndexAlgorithm_TUNING_GATING_MAX_DURATION_MINUTES_MAX = 3000;
    public static final float GasIndexAlgorithm_TUNING_STD_INITIAL_MIN = 10;
    public static final float GasIndexAlgorithm_TUNING_STD_INITIAL_MAX = 5000;
    public static final float GasIndexAlgorithm_TUNING_GAIN_FACTOR_MIN = 1;
    public static final float GasIndexAlgorithm_TUNING_GAIN_FACTOR_MAX = 1000;
    public static final float GasIndexAlgorithm_MEAN_VARIANCE_ESTIMATOR__GAMMA_SCALING = 64.f;
    public static final float GasIndexAlgorithm_MEAN_VARIANCE_ESTIMATOR__ADDITIONAL_GAMMA_MEAN_SCALING = 8.f;
    public static final float GasIndexAlgorithm_MEAN_VARIANCE_ESTIMATOR__FIX16_MAX = 32767.f;

}
